package com.example.demo.service;

import com.example.demo.bean.GroupMessageBean;
import com.example.demo.repository.GroupMessageRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;
import java.util.List;
import java.util.Map;

@Transactional
@Service
public class GroupMessageService {

    @Autowired
    GroupMessageRepository groupMessageRepository;

    public GroupMessageBean addGroupMessageBean(GroupMessageBean bean){
        return groupMessageRepository.save(bean);
    }

    public List<Map<String, Object>> findGroupMessageBean(String groupName){
        List<Map<String, Object>> list = groupMessageRepository.findGroupMessage(groupName);
        return list;
    }
}
